from django.db import models

# Create your models here.


class Area(models.Model):
    """省市区三级联动"""
    name = models.CharField(verbose_name="名称", max_length=20)
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, related_name='subs', blank=True, verbose_name="上级行政区划")

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '行政区划'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
